From: Jan D Date: Sun, 26 Sep 2010 15:39:10 +0000 (+0200) Subject: * xgselect.c (xg_select): Clear file descriptors not set from rfds and wfds. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~18^2~454 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=2ce5a8bf9d7b0b430c6f9161e36685aef054339a;p=emacs.git * xgselect.c (xg_select): Clear file descriptors not set from rfds and wfds. --- diff --git a/src/ChangeLog b/src/ChangeLog index ea57ffe8273..3adcd9d7a4d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-09-26 Jan Djärv + + * xgselect.c (xg_select): Clear file descriptors not set from + rfds and wfds. + 2010-09-21 Stefan Monnier * syntax.c (back_comment): Detect the case where a 1-char comment diff --git a/src/xgselect.c b/src/xgselect.c index d93c1bdf405..a06713458a0 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -113,11 +113,17 @@ xg_select (max_fds, rfds, wfds, efds, timeout) if (rfds && FD_ISSET (i, rfds)) ++retval; else ++our_fds; } + else if (rfds) + FD_CLR (i, rfds); + if (have_wfds && FD_ISSET (i, &all_wfds)) { if (wfds && FD_ISSET (i, wfds)) ++retval; else ++our_fds; } + else if (wfds) + FD_CLR (i, wfds); + if (efds && FD_ISSET (i, efds)) ++retval; }